package com.iknow.view.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ListView;

public class MyListView extends ListView
  implements AbsListView.OnScrollListener
{
  private int mFirstVisibleItem;
  private OnNeedMoreListener mOnNeedMoreListener;
  private int mScrollState = 0;

  public MyListView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    setOnScrollListener(this);
  }

  public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
  {
    int i;
    boolean bool = super.onInterceptTouchEvent(paramMotionEvent);
    if (this.mScrollState == 2)
      i = 1;
    while (true)
    {
      return i;
      i = bool;
    }
  }

  public void onScroll(AbsListView paramAbsListView, int paramInt1, int paramInt2, int paramInt3)
  {
    if (this.mOnNeedMoreListener == null);
    while (true)
    {
      while (true)
      {
        do
        {
          return;
          if (paramInt1 == this.mFirstVisibleItem)
            break label36;
        }
        while (paramInt1 + paramInt2 < paramInt3);
        this.mOnNeedMoreListener.needMore();
      }
      label36: this.mFirstVisibleItem = paramInt1;
    }
  }

  public void onScrollStateChanged(AbsListView paramAbsListView, int paramInt)
  {
    this.mScrollState = paramInt;
  }

  public void setOnNeedMoreListener(OnNeedMoreListener paramOnNeedMoreListener)
  {
    this.mOnNeedMoreListener = paramOnNeedMoreListener;
  }

  public static abstract interface OnNeedMoreListener
  {
    public abstract void needMore();
  }
}